<script setup>
import { ref } from 'vue';
import Child from './Child.vue';

const acceptData = ref(null);
const nameData = ref(null);
const clickFn = (data) => {
  console.log('data', data);
  // 针对传过来的数据做处理
  acceptData.value = data;
};

const nameFn = (name) => {
  console.log('name', name);
  // 针对传过来的数据做处理
  nameData.value = name;
};

</script>

<template>
  <p>Emits</p>
  <div>
    <Child
      @clickFn="clickFn"
      @nameFn="nameFn"
    />
  </div>
  <p>接收到的数据：{{ acceptData }}</p>
  <p>接收到的数据name：{{ nameData }}</p>
</template>
